package com.asia5b.a5mall.middleware.base

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.Lifecycle
import androidx.viewpager2.adapter.FragmentStateAdapter

/**
 * Created by zhangyuncai on 2020/8/21.
 */
class SimpleFragmentAdapter(fragmentManager: FragmentManager
                            , lifecycle: Lifecycle,
                            val fragments: MutableList<Fragment>) : FragmentStateAdapter(fragmentManager, lifecycle) {
    override fun getItemCount(): Int {
        return fragments.size
    }

    override fun createFragment(position: Int): Fragment {
        return fragments.get(position)
    }
}